package com.example.demo.service;

import com.example.demo.domain.PageResult;
import com.example.demo.domain.entity.VojSubmissions;
import com.example.demo.domain.exam.Exam;
import com.example.demo.domain.exam.ExamPaper;
import com.example.demo.domain.exam.ExamSubmitLog;
import com.example.demo.domain.exam.QueryModel;
import com.example.demo.domain.exam.UserExamAns;
import com.example.demo.domain.exam.condition.ExamCondition;
import com.example.demo.dto.UserExamAnswerDTO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface ExamForUserService {

    /**
     * 获取所有考试
     *
     * @return 所有考试
     */
    PageResult<Exam> page(QueryModel<ExamCondition> model);

    /**
     * 考试详细信息
     *
     * @return 试卷信息
     */
    ExamPaper getExamDetail(Long examId, HttpServletRequest request);

    /**
     * 暂存试题
     *
     * @param dto 答案列表
     */
    void stagingExamAns(UserExamAnswerDTO dto);

    /**
     * 提交试题
     *
     * @param dto 答案列表
     */
    void submitExamAns(UserExamAnswerDTO dto);

    /**
     * 获取暂存区的答案
     * @param examId 试卷标识
     * @return 答案列表
     */
    List<UserExamAns> getStagingExamAns(Long examId);

    /**
     * 获取用户提交后的答案
     * @param examId 试卷标识
     * @return 答案列表
     */
    List<UserExamAns> getExamAns(Long examId);

    void submitExamLog(ExamSubmitLog entity);

    void updateSubmissionLog(Long submissionId, double score, Integer status, VojSubmissions submissions);

    Long submitEvaluation(ExamSubmitLog entity);

}
